﻿<phone:PhoneApplicationPage 
    x:Class="PhoneInfo.Page.mian"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
     xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance"
    shell:SystemTray.IsVisible="false" Style="{StaticResource TransitionPageStyle}"
     xmlns:local="clr-namespace:PhoneInfo"
    Loaded="PhoneApplicationPage_Loaded" toolkit:TiltEffect.IsTiltEnabled="True" 
    >
    <phone:PhoneApplicationPage.Resources>
        <local:FixEmptyUrl x:Key="FixUrl"/>
        <Style x:Key="ButtonPhoneSelf" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <CompositeTransform/>
                            </Grid.RenderTransform>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0" To="Pressed">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="grid">
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.9"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.85"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.9"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="grid">
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.9"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.85"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.85"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image Name="imgModel" Source="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content=""/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyle1" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Canvas>
        					<Image Height="172" Canvas.Left="14" Canvas.Top="8" Width="353" Source="/Icon/pic_01.jpg"/>
        					<TextBlock Canvas.Left="20" TextWrapping="Wrap" Text="手机品牌" Canvas.Top="148" FontSize="22.667"/>
        					
        				</Canvas>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        	<Setter Property="Foreground" Value="#FF0091D9"/>
        </Style>
    </phone:PhoneApplicationPage.Resources>
    <Grid x:Name="LayoutRoot" Background="{Binding Source={StaticResource Theme}, Path=cuTheme.TextBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28" Orientation="Horizontal">
            <TextBlock x:Name="PageTitle" Text="手机资料大全"  Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.TitleBrush}"  FontSize="60"  Margin="9,3,0,0" />
            <Button Content="Button" Name="imgBtn" Margin="20,20,0,0" Tag="/Icon/model.png"
                    Style="{StaticResource ButtonPhoneSelf}" Click="ShowSelf_Click" Width="55"/>
        </StackPanel>
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0" >
            <ListBox x:Name="MoreListBox" Margin="0,200,-12,0"  ItemsSource="{Binding MainNavigationItems}"   Tap="List_Tap" BorderThickness="18,0,0,0" >
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <toolkit:WrapPanel Orientation="Horizontal"  VerticalAlignment="Top" Margin="0"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Canvas Margin="6,7" Height="172" Width="172">
                            <Image  Width="172" Height="172" delay:LowProfileImageLoader.UriSource="{Binding Picurl, Converter={StaticResource FixUrl}}"/>
                            <TextBlock   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.IndexgrayAndWhite}" 
                                         Text="{Binding Title}" 
                                         Width="167" Height="30"  FontSize="24" TextAlignment="Left"  
                                         TextWrapping="Wrap" VerticalAlignment="Bottom" Canvas.Top="137" Canvas.Left="5"/>
                        </Canvas>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Button Content="手机品牌" HorizontalAlignment="Left" Height="193" 
                    Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.IndexgrayAndWhite}" 
                    Margin="12,12,0,0" Style="{StaticResource ButtonStyle1}" 
                    VerticalAlignment="Top" Width="430" Click="Button_Click" />
        </Grid>
        <Popup x:Name="phonePkTemp">
            <Grid Background="#FFE5E5E5" Height="800" Width="480">
                <Image x:Name="OverImage" Height="800" Width="480" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill"/>
            </Grid>
        </Popup>
    </Grid>
</phone:PhoneApplicationPage>
